﻿/*http://passport.iwgame.com/sso/loginpage.do*/
const CryptoJS = require('crypto-js')
const btoa = require('btoa')
function getS(user, pwd) {
    const k = [
        102,
        55,
        52,
        53,
        48,
        101,
        99,
        51,
        53,
        56,
        55,
        50,
        55,
        101,
        102,
        99,
        50,
        51,
        50,
        57,
        52,
        50,
        54,
        100,
        56,
        56,
        56,
        102,
        48,
        54,
        100,
        52
    ];
    var b = `{"identityId":"${user}","credential":"${pwd}","captcha":"","capId":"1c738643f73d4951835a63acb15e79d2","accountType":"PERSONALITY","gotourl":"","ls":"","pid":""}`;
    var d = btoa(b);
    var b = CryptoJS.MD5(d).toString() + b;
    var d = String.fromCharCode.apply(null, k);
    var d = CryptoJS.enc.Hex.parse(d);
    var b = CryptoJS.AES.encrypt(b, d, {
        mode: CryptoJS.mode.ECB
    }).ciphertext.toString();
    return btoa(b);
}

console.log(getS(13888888888,111111))
